home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / viewkit / xcontact / onlineHelp / sample.sgm < prev    next >
Encoding:
Text File  |  1994-08-02  |  12.5 KB  |  398 lines

  1.  
  2. <dochelp>
  3.  
  4. <!-- 
  5.   ==================================================================
  6.   This block denotes a SGML-style comment.
  7.  
  8.   For those that are unfamiliar with SGML, this sample file
  9.   will try to cover the usage of a variety of the tags that
  10.   are used in the XHELP DTD. The examples shown in this sample
  11.   should be sufficient for a writer to produce a very high-quality,
  12.   functional help document for use with an application.
  13.  
  14.   It is best to view this sample once it has been published,
  15.   and then compare what you see in the viewing software to
  16.   the actual tags displayed in this file. 
  17.  
  18.   Each HelpTopic block written below displays how to use the
  19.   DTD to implement specific elements/constructs. It should be
  20.   fairly self-explanatory.
  21.  
  22.   A couple of things to look for when constructing/editing
  23.   your SGML file:
  24.  
  25.     o Make sure a starting element tag has an associated
  26.           end tag! If not, then the file will not compile
  27.           properly. This is analagous to missing a bracket
  28.           or paranthesis in a C program!
  29.  
  30.     o Ending elements can be fully-qualified to denote the
  31.       element they are ending, such as "</HelpTopic>" or
  32.       they can use the shorthand (but less obvious) notation
  33.       of "</>".
  34.  
  35.     o SGML is NOT case sensitive! "HELPTOPIC" is the same
  36.        as "helptopic", which is the same as "HelpTopic", etc.
  37.   ==================================================================
  38. -->
  39.  
  40. <HelpTopic HelpID="intro">
  41. <Helplabel>SGI Sample SGML File</Helplabel>
  42. <Description>
  43. <para>This file contains examples using many of the constructs used 
  44. in the XHELP DTD.</>
  45. <para>Notice that the general outline used for putting together 
  46. a help "card" is defined by this particular SGML block. The preceding tag
  47. defines the title that will be displayed for this card. The area you
  48. are currently reading is a description for the feature or function you
  49. are documenting. It is not necessary to use each of these tags, although
  50. the "HelpTopic" tag is required.</>
  51.  
  52. <para>A writer of help information may also wish to include a glossary
  53. of terms. In that way, the documenter can tag terms within the text,
  54. and have them display a specified definition from within the viewer. 
  55. A sample of this is: <glossterm>sgihelp</glossterm>.</>
  56. <para>The actual definition for the term is found at the end of this
  57. SGML sample.</>
  58. </Description>
  59. </HelpTopic>
  60.  
  61.  
  62.  
  63. <!--
  64.   ==================================================================
  65.   It's important to point out that the "HelpID" is the glue that
  66.   binds the help text to the application, through the use of the
  67.   provided Help API (library, header file).
  68.   ==================================================================
  69. -->
  70.  
  71. <HelpTopic HelpID="helpid_info">
  72. <Helplabel>What is a HelpID?</Helplabel>
  73. <Description>
  74. <para>The HelpID attribute is used to by your application to
  75. instruct the help server which help "card" to display. In this
  76. case, sending the help server an ID of "helpid_info" would bring up
  77. this particular block (or "card").</>
  78. <para>The other "ID" is often used as an anchor point 
  79. (and should be used within an "ANCHOR" tag) for hypertext
  80. links within your text. If you wish to refer to a particular card
  81. one simply uses the ID as the anchor point for the link syntax.</>
  82. </Description>
  83. </HelpTopic>
  84.  
  85.  
  86.  
  87. <!--
  88.   ==================================================================
  89.   This section illustrates the simple usage of specifying a note,
  90.   warning, tip, or caution within your help document.
  91.   ==================================================================
  92. -->
  93.  
  94. <HelpTopic HelpID="note_example">
  95. <Helplabel><Anchor Id="AI003">Using Notes, Warnings or Tips Within a Paragraph</Helplabel>
  96. <Description>
  97. <para>Within the paragraph tag, there are a variety of text marking
  98. mechanisms. Each of these delineations must appear as part of the
  99. paragraph ("para") element.</>
  100. <para>This area shows the documentor how a warning, note or "tip"
  101. can be used within a persons's help text.</>
  102.  
  103. <para>
  104. <warning><para>Be Careful. This is a warning.</></warning>
  105. <note><para>For your information, this is a note.</></note>
  106. <tip><para>When you prepare your help file, you may wish to include a tip.</>
  107. </tip>
  108. <caution><para>Use a caution tag when you wish to have the user use caution!</>
  109. </caution>
  110. </para>
  111. </Description>
  112. </HelpTopic>
  113.  
  114.  
  115.  
  116. <!--
  117.   ==================================================================
  118.   This next section illustrates how to display computer output, 
  119.   program listings, etc. within your help document.
  120.   ==================================================================
  121. -->
  122.  
  123. <HelpTopic HelpID="literal_example">
  124. <Helplabel>Using Literals or Examples Within a Paragraph</Helplabel>
  125. <Description>
  126. <para>
  127. This area shows the documentor how to implement specific examples within
  128. their help text. It also describes how to the "literal" tag.</>
  129. <para>
  130. When used within a paragraph, the LiteralLayout tag
  131. tells the viewing software to take this next block "as is",
  132. with all accompanying new-lines and spacing left intact.</>
  133. <Example>
  134. <Title>Various Examples: ComputerOutput, LiteralLayout, ProgramListing</Title>
  135.  
  136. <para>
  137. What follows is a computer output listing from when a
  138. user typed <userInput>ls</userInput> :
  139. <ComputerOutput>
  140. % ls -l
  141. total 6777
  142. -rwxr-xr-x  1 guest  guest   29452 Mar  8 19:12 menu*
  143. -rw-r--r--  1 guest  guest    2375 Mar  8 19:11 menu.c++
  144. </ComputerOutput>
  145. </para>
  146.  
  147. <para>
  148. Each of the subsequent three entries should be indented and on their
  149. own line:
  150. <LiteralLayout>
  151.     Here is line one.
  152.     This is line two.
  153.     This is line three.
  154. </LiteralLayout>
  155. </para>
  156.  
  157. <para>
  158. The following is a listing from a "C" program:
  159. <ProgramListing>
  160.     #include "X11/Xlib.h"
  161.     #include "helpapi/HelpBroker.h"
  162.  
  163.     void main(int, char**)
  164.     {
  165.          /* default to the value of the DISPLAY env var */
  166.          Display *display = XOpenDisplay(NULL);
  167.  
  168.          if( display ) {
  169.                /* initialize the help server */
  170.                SGIHelpInit(display, "MyApp", ".");
  171.          }
  172.          ...
  173.     }
  174. </ProgramListing>
  175. </para>
  176. </Example>
  177.  
  178. </Description>
  179. </HelpTopic>
  180.  
  181.  
  182.  
  183. <!--
  184.   ==================================================================
  185.   This next section illustrates how to incorporate graphics within
  186.   your help text.
  187.   ==================================================================
  188. -->
  189.  
  190. <HelpTopic HelpID="graphic_example">
  191. <Helplabel>Using Graphics or Figures Within Your Help Text</Helplabel>
  192. <Description>
  193. <para>
  194. This area displays how a graphics or figure can be used within the flow of
  195. your information. The following figure is in the "GIF" format:
  196. </para>
  197.  
  198. <Figure ID="figure_01" Float="Yes">
  199.     <title>A GIF Raster Image</title>
  200.     <Graphic fileref="sample1.gif" format="GIF"></>
  201. </Figure>
  202.  
  203. <para>
  204. Currently, support is provided for <emphasis>raster</emphasis> graphics in
  205. the GIF and TIF formats. Support is provided for <emphasis>vector</emphasis>
  206. graphics utilizing the CGM format.
  207. </para>
  208. <para>
  209. This next figure in the CGM (Computer Graphics Metafile) format:
  210. </para>
  211.  
  212. <Figure ID="figure_02">
  213.     <title>A CGM Vector Image</title>
  214.     <Graphic fileref="sample2.cgm" format="CGM"></>
  215. </Figure>
  216.  
  217. <para>
  218. A special note that all equations are treated as inline images, as shown
  219. here:
  220. <equation>
  221.     <Graphic fileref="matrix.gif" format="GIF"></>
  222. </equation>
  223. </para>
  224.  
  225. </Description>
  226. </HelpTopic>
  227.  
  228.  
  229.  
  230. <!--
  231.   ==================================================================
  232.   Hyperlinks can be a very powerful navigation mechanism!
  233.   Liberal usage is encouraged.
  234.   ==================================================================
  235. -->
  236.  
  237. <HelpTopic HelpID="link_example">
  238. <Helplabel>Using HyperLinks</Helplabel>
  239. <Description>
  240. <para>One of the most powerful capabilities of the sgihelp viewer
  241. is the use of hyperlinks to associate like pieces of information. 
  242. Constructing these links in SGML is trivial.</>
  243. <para>Notice that the "Link" element requires an attribute called
  244. "Linkend". This defines the area (anchor) to link to. The "Linkend"
  245. attribute points to the ID of some SGML element. In composing
  246. help text, it is probably best to assign an ID to each "HelpTopic"
  247. element, and use those same ID's when specifying a Link.</>
  248. <para>A link is defined below:</>
  249. <para>For more information about using Notes, refer to the area
  250. entitled <Link Linkend="AI003">"Using Notes, Warnings or Tips
  251. Within a Paragraph"</Link></>
  252. <para>Note that the "Anchor" tag can also be used within a
  253. document to point to any level of granularity the author
  254. wishes to link to.</>
  255. </Description>
  256. </HelpTopic>
  257.  
  258.  
  259.  
  260. <!--
  261.   ==================================================================
  262.   Note that there are *many* ways to specify lists. This example
  263.   shows some commonly-used permutations.
  264.   ==================================================================
  265. -->
  266.  
  267. <HelpTopic HelpID="list_example">
  268. <Helplabel>Using Lists Within Your Help Text</Helplabel>
  269. <Description>
  270. <para>This area displays how a person can author 
  271. various types of lists within their help text.</para>
  272.  
  273. <para>Here is an itemized list that uses a dash to preface each item:</para>
  274. <ItemizedList Mark="dash">
  275. <ListItem><para>First Entry</></ListItem>
  276. <ListItem><para>Second Entry</></ListItem>
  277. <ListItem><para>Third Entry</></ListItem>
  278. </ItemizedList>
  279.  
  280. <para>Here is an itemized list that uses a bullet to preface each item:</para>
  281. <ItemizedList Mark="bullet">
  282. <ListItem><para>First Entry</></ListItem>
  283. <ListItem><para>Second Entry</></ListItem>
  284. </ItemizedList>
  285.  
  286. <para>Here is an ordered list, using standard enumeration:</para>
  287. <OrderedList>
  288. <ListItem><para>First Entry</></ListItem>
  289. <ListItem><para>Second Entry</></ListItem>
  290. <ListItem><para>Third Entry</></ListItem>
  291. </OrderedList>
  292.  
  293. <para>Here is another ordered list, using upper-case Roman enumeration,
  294. showing nesting (sub-items) within the list (outline format):</para>
  295. <OrderedList Numeration="Upperroman">
  296. <ListItem><para>First Entry</></ListItem>
  297. <ListItem><para>Second Entry
  298.     <OrderedList Numeration="Upperalpha" InheritNum="Inherit">
  299.         <ListItem><para>First SubItem</></ListItem>
  300.         <ListItem><para>Second SubItem</></ListItem>
  301.         <ListItem><para>Third SubItem</></ListItem>
  302.         <ListItem><para>Fourth SubItem</></ListItem>
  303.     </OrderedList>
  304. </></ListItem>
  305. <ListItem><para>Third Entry</></ListItem>
  306. </OrderedList>
  307.  
  308. <para>Here is a variable list of terms:</para>
  309. <VariableList>
  310. <VarListEntry>
  311. <term>SGI</term>
  312. <ListItem><para>Silicon Graphics, Inc.</></ListItem>
  313. </VarListEntry>
  314. <VarListEntry>
  315. <term>SGML</term>
  316. <ListItem><para>A Meta-language for defining documents.</></ListItem>
  317. </VarListEntry>
  318. </VariableList>
  319.  
  320. </Description>
  321. </HelpTopic>
  322.  
  323.  
  324.  
  325. <!--
  326.   ==================================================================
  327.   Some final examples...
  328.   ==================================================================
  329. -->
  330.  
  331. <HelpTopic HelpID="misc_example">
  332. <Helplabel>Other Miscellaneous Textual Attributes</Helplabel>
  333. <Description>
  334. <para>This area displays some miscellaneous tags that can be used
  335. within the context of your help document.</para>
  336.  
  337. <para>
  338. <Comment>This is a comment that is not to be confused
  339. with the SGML-style comment! Instead, this comment will be
  340. parsed and carried into the text of your document. Usually it's
  341. used in production, for specifying to someone an area of concern,
  342. an area that needs editing, etc.
  343. </Comment> 
  344. </para>
  345.  
  346. <para>Within your text, you may wish to denote a footnote.
  347. <Footnote id="foot1"><para>This block is a footnote!</></Footnote>
  348. The XHELP DTD will allow you to do that.
  349. </para>
  350.  
  351. <para>
  352. You may wish to add a copyright symbol to your text, such as:
  353. Silicon Graphics, Inc.<trademark Class="Copyright"></>
  354. </para>
  355. </Description>
  356. </HelpTopic>
  357.  
  358.  
  359.  
  360. <!--
  361.   ==================================================================
  362.   If you wish to use/have a glossary of terms within your help text,
  363.   it is advised to put it at the end of your help "book", as shown 
  364.   here. NOTE: CR or other characters (#PCDATA) is NOT allowed 
  365.   between the <Glossary> and <Title> tags! (mixed content model)
  366.   ==================================================================
  367. -->
  368.  
  369. <Glossary>
  370. <Title>Glossary</Title>
  371. <GlossEntry>
  372. <GlossTerm>help</GlossTerm>
  373. <GlossDef>
  374. <para>To give assistance to; to get (oneself) out of a difficulty;
  375. a source of aid.</>
  376. </GlossDef>
  377. </GlossEntry>
  378. <GlossEntry>
  379. <GlossTerm>sgihelp</GlossTerm>
  380. <GlossDef>
  381. <para>This is Silicon Graphics, Inc. version of a "Xhelp" compatible
  382. server. Through the use of an available API, and a help text
  383. compiler, books can be constructed that can be used to render
  384. help information for the given application.</>
  385. </GlossDef>
  386. </GlossEntry></Glossary>
  387.  
  388.  
  389. <!--
  390.   ==================================================================
  391.   Don't forget the very last ending tag...!!!
  392.   ==================================================================
  393. -->
  394.  
  395. </dochelp>
  396.  
  397.